package com.ruoyi.mall.service.impl;

import java.util.List;


import com.ruoyi.mall.entity.MallCategory;
import com.ruoyi.mall.mapper.MallCategoryMapper;
import com.ruoyi.mall.service.IMallCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.core.text.Convert;

/**
 * 商品分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-05-19
 */
@Service
public class MallCategoryServiceImpl implements IMallCategoryService
{
    @Autowired
    private MallCategoryMapper mallCategoryMapper;

    /**
     * 查询商品分类
     * 
     * @param goodCategoryId 商品分类ID
     * @return 商品分类
     */
    @Override
    public MallCategory selectMallCategoryById(Long goodCategoryId)
    {
        return mallCategoryMapper.selectMallCategoryById(goodCategoryId);
    }

    /**
     * 查询商品分类列表
     * 
     * @param MallCategory 商品分类
     * @return 商品分类
     */
    @Override
    public List<MallCategory> selectMallCategoryList(MallCategory MallCategory)
    {
        return mallCategoryMapper.selectMallCategoryList(MallCategory);
    }

    /**
     * 新增商品分类
     * 
     * @param MallCategory 商品分类
     * @return 结果
     */
    @Override
    public int insertMallCategory(MallCategory MallCategory)
    {
        return mallCategoryMapper.insertMallCategory(MallCategory);
    }

    /**
     * 修改商品分类
     * 
     * @param MallCategory 商品分类
     * @return 结果
     */
    @Override
    public int updateMallCategory(MallCategory MallCategory)
    {
        return mallCategoryMapper.updateMallCategory(MallCategory);
    }

    /**
     * 删除商品分类对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteMallCategoryByIds(String ids)
    {
        return mallCategoryMapper.deleteMallCategoryByIds(Convert.toStrArray(ids));
    }
    /**
     * 查询商品分类
     *
     * @param pid ID
     * @return 结果
     */
    @Override
    public List<MallCategory> selectMallCategoryByPId(Long pid) {
        return mallCategoryMapper.selectMallCategoryByPId(pid);
    }

    /**
     * 删除商品分类信息
     * 
     * @param goodCategoryId 商品分类ID
     * @return 结果
     */
    @Override
    public int deleteMallCategoryById(Long goodCategoryId)
    {
        return mallCategoryMapper.deleteMallCategoryById(goodCategoryId);
    }
}
